//
//  ButtonCollectionCell.m
//  Learn
//
//  Created by chijianguo on 2024/3/29.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "ButtonCollectionCell.h"

@implementation ButtonCollectionCell
#pragma mark - Intial
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setUpUI];
    }
    return self;
}
#pragma mark - UI
- (void)setUpUI
{
    self.imView = [[UIImageView alloc] init];
    self.imView.layer.cornerRadius = 15;
    self.imView.layer.masksToBounds = YES;
    [self addSubview:self.imView];
    
    self.titleLB = [[UILabel alloc] init];
    self.titleLB.font = [UIFont systemFontOfSize:12];
    self.titleLB.textColor = rgbHex(0x333333, 1);
    self.titleLB.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLB];
    
}
#pragma mark - 布局
- (void)layoutSubviews
{
    [self.imView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(5);
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(-15);
        make.height.mas_equalTo(self.imView.mas_width);
    }];
    
    [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imView.mas_bottom).offset(5);
        make.left.right.equalTo(self).offset(0);
        make.bottom.equalTo(self).offset(0);
    }];
}




@end
